package com.yuyou.fn.tms.util;

import com.yuyou.fn.common.lang.Tuple3;
import org.apache.commons.lang3.StringUtils;

public class PeriodUtils {


    public static Tuple3<Long,String,String> periodName2Sea(String periodName){

        String year  = periodName.substring(0,4);

        if(periodName.indexOf("寒") != -1 ){
            return Tuple3.of(2l,year,"寒假班");
        }else if(periodName.indexOf("春") != -1 ){
            return Tuple3.of(3l,year,"春季班");
        }else if(periodName.indexOf("暑") != -1 ){
            return Tuple3.of(4l,year,"暑假班");
        }else if(periodName.indexOf("秋") != -1 ){
            return Tuple3.of(5l,year,"秋季班");
        }else {
            return Tuple3.of(1l,year,StringUtils.EMPTY);
        }

    }

    public static void main(String[] args) {
        System.out.println(periodName2Sea("2019春季"));
        System.out.println(periodName2Sea("2019寒假"));
        System.out.println(periodName2Sea("2019暑假"));
        System.out.println(periodName2Sea("2019秋季"));
        System.out.println(periodName2Sea("2019季"));
    }

}
